<template>
  <div class="bottom-bar">
    <div class="bar-left">
      <div>
        <i class="icon service"></i>
        <span>客服</span>
      </div>
      <div>
        <i class="icon shop"></i>
        <span>店铺</span>
      </div>
      <div>
        <i class="icon collection"></i>
        <span>收藏</span>
      </div>
    </div>
    <div class="bar-right">
      <div class="cart" @click="addToCart">加入购物车</div>
      <div class="purchase">购买</div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "DetailBottomBar",
    methods:{
      addToCart(){
        this.$emit("addCart")
      }
    }
  }
</script>

<style scoped>
  .bottom-bar {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 100;
    background-color: pink;
    height: 49px;
    display: flex;
  }

  .bar-left,
  .bar-right {
    flex: 1;
  }

  .bar-left {
    display: flex;
    align-items: flex-end;
    font-size: 12px;
    background-color: #ffffff;
  }

  .bar-left div {
    height: 100%;
    width: 100%;
    text-align: center;

  }

  .bar-left i {
    display: block;
    width: 22px;
    height: 22px;
    margin: 10px auto 2px;
    background: url("../../../assets/img/detail/detail_bottom.png") 0 0/100%;
  }

  .bar-left .service {
    background-position: 0 -54px;
  }

  .bar-left .shop {
    background-position: 0 -98px;
  }

  .bar-right {
    display: flex;
    line-height: 49px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
  }

  .bar-right .cart,
  .bar-right .purchase {
    flex: 1;
    width: 100%;
    height: 100%;
  }

  .cart {
    background-color: rgba(235, 241, 1, 0.99);
  }

  .purchase {
    background-color: rgba(239, 105, 143, 0.99);
    color: #ffffff;
  }
</style>
